<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script src="../js/vue.js"></script>
<div id="app">
<!-- 1 正确的写法，一般不推荐这样写，推荐第三种写法-->
  <h2 v-if="score>=90">优秀</h2>
  <h2 v-else-if="score>=80">良好</h2>
  <h2 v-else-if="score>=60">及格</h2>
  <h2 v-else>不及格</h2>
<!--2 这样写也是可以的-->
  <h2 v-if="score>=90">优秀</h2>
  <h2 v-else-if="score>=80">良好</h2>
  <h2 v-else-if="score>=60">及格</h2>
  <h2 v-else="score<60">不及格</h2>
<!--推荐写法-->
  <h2>{{finalScore}}</h2>
</div>
<script>
    const app = new Vue({
        el:'#app',
        data:{
            score:90,
        },
        computed:{
          finalScore() {
            let showMesage;
            if (this.score >= 90) {
              showMesage = '优秀'
            } else if (this.score >= 80) {
              showMesage = '良好'
            } else if (this.score >= 60) {
              showMesage = '及格'
            } else {
              showMesage = '不及格'
            }
            return showMesage
          }
    }

    })
</script>

</body>
</html>